import event from '@/axios/event';
/*
** 区域
*/
// 获取区域组织树
export const getAreaTree = data => event.get('/tArea/tree', { params: data });
// 获取区域列表
export const getAreaList = data => event.get('/tArea/getList', { params: data });
//删除
export const areaDel = id => event.get('/tArea/del/' + id);
//新增
export const addArea = data => event.post('/tArea/save', data);
//新增
export const modifyArea = data => event.post('/tArea/modify', data);


/*
** 来源
*/
// 来源分页
export const getSourcePage = data => event.get('/tSource/page', { params: data });
// 来源列表
export const getSourceList = data => event.get('/tSource/getList', { params: data });
//新建
export const addSource = data => event.post('/tSource/save', data);
// 详情
export const getSource = id => event.get(`/tSource/getInfo/${id}`);
//修改
export const modifySource = data => event.post('/tSource/modify', data);
//删除
export const delSource = id => event.get('/tSource/del/' + id);



/*
** 设备
*/
// 设备分页
export const getEquipmentPage = data => event.get('/tEquipment/page', { params: data });

//所有设备
export const getEquipmentList = data => event.get('/tEquipment/getList', { params: data });

//新建
export const addEquipment = data => event.post('/tEquipment/save', data);

// 详情
export const getEquipment = id => event.get(`/tEquipment/getInfo/${id}`);

//修改
export const modifyEquipment = data => event.post('/tEquipment/modify', data);

//删除
export const delEquipment = id => event.get('/tEquipment/del/' + id);

//某设备所有通道
export const getPartList = id => event.get('/tEquipmentPart/getList/' + id);

/*
** 预案
*/
// 预案分页
export const getPlanPage = data => event.get('/tPlan/page', { params: data });
//某通道预案列表
export const getPlanList = id => event.get(`/tPlan/getList/${id}`);
//预案下拉框
export const getPlanListAll = id => event.get(`/tPlan/getList`);
//更新预案
export const addPlanList = data => event.post('/tPlan/saveList', data);
//新增预案
export const addPlan = data => event.post('/tPlan/save', data);
//修改预案
export const modifyPlan = data => event.post('/tPlan/modify', data);
//删除
export const delPlan = id => event.get('/tPlan/del/' + id);


/*
** 告警信息
*/
//告警分页
export const getWarningPage = data => event.get(`/tWarning/page`, { params: data });
//告警触发预案分页
export const getPlanRecordPage = data => event.get(`/tPlanRecord/page`, { params: data });
//手动触发预案
export const makePlanStart = (partId, warningId) => event.get('/tPlan/startPlan/' + partId + '/' + warningId);

/*
** 告警账户
*/
//获取
export const getUserInfo = data => event.get(`/tUser/getUserInfo`);
//更新提交
export const saveUser = data => event.post(`/tUser/saveUser`, data);